<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
		<link rel="shortcut icon" type="image/x-icon" href="/youju100.ico" />
		<link rel="stylesheet" type="text/css" href="/assets/plusfang/css/reset.css"/>
		<link rel="stylesheet" type="text/css" href="/assets/plusfang/css/style.css"/>
		<link rel="stylesheet" href="/assets/plusfang/css/header-footer.css">
		<link rel="stylesheet" type="text/css" href="/assets/plusfang/css/home.css"/>
		<script src="/assets/js/building/jquery-1.11.1.min.js"></script>
		<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0"></script>
	    <script type="text/javascript">
	    function myFun(result){
	        $(".ip-dingwei").after(result.name.substring(0,result.name.length-1));
	    }
	    var myCity = new BMap.LocalCity();
	    myCity.get(myFun);
	    </script>
	   	<title>优居100</title>
	</head>
	<body>
		<header>
	        <div id="header" class="homepage-wrapper">
	        	<div class="header-left">
		            <a class="udf-icon u-youju" href=""></a>
		            <span class="location"><span class="udf-icon u-dingwei"></span>上海</span>
		            <input type="hidden" value="all" id="showcity" style="display: none;">
		            <a href="/" class="index">首页</a>
		        </div>
	        </div>
	    </header>
		<!-- Swiper -->
<!-- 	    <div class="swiper-container">
	        <div class="swiper-wrapper">
	            <div class="swiper-slide" style="background-image: url(<?php echo config_item('photo.plusfang.domain');?>/assets/plusfang/img/banner1.jpg);"><div style="width: 100%;height: 100%;background-color: rgba(0,0,0,.15);"></div></div>
	            <div class="swiper-slide" style="background-image: url(<?php echo config_item('photo.plusfang.domain');?>/assets/plusfang/img/banner2.jpg);"><div style="width: 100%;height: 100%;background-color: rgba(0,0,0,.15);"></div></div>
	            <div class="swiper-slide" style="background-image: url(<?php echo config_item('photo.plusfang.domain');?>/assets/plusfang/img/banner3.jpg);"><div style="width: 100%;height: 100%;background-color: rgba(0,0,0,.15);"></div></div>
	            <div class="swiper-slide" style="background-image: url(<?php echo config_item('photo.plusfang.domain');?>/assets/plusfang/img/banner4.jpg);"><div style="width: 100%;height: 100%;background-color: rgba(0,0,0,.15);"></div></div>
	        </div> -->
	        		<!-- slider -->
	    <div id="banner" class="flexslider">
			<ul class="slides">
				<li><div class="img"><div class="img-cover"></div><img src="<?php echo config_item('photo.plusfang.domain');?>/assets/plusfang/img/banner1.jpg"/></div></li>
				<li><div class="img"><div class="img-cover"></div><img src="<?php echo config_item('photo.plusfang.domain');?>/assets/plusfang/img/banner2.jpg"/></div></li>
				<li><div class="img"><div class="img-cover"></div><img src="<?php echo config_item('photo.plusfang.domain');?>/assets/plusfang/img/banner3.jpg"/></div></li>
				<li><div class="img"><div class="img-cover"></div><img src="<?php echo config_item('photo.plusfang.domain');?>/assets/plusfang/img/banner4.jpg"/></div></li>
			</ul>

	        <!-- Add Pagination -->
	        <div class="swiper-pagination"></div>
	        <h1 class="banner-title">好房源那么多，我们为您精挑细选</h1>
	        <div class="banner-search">
	        	<span class="search-title">搜索房源</span>
	        	<input type="text" placeholder="请输入你想安家的城市" id="search_fang" />
	        	<button>go</button>
	        	<!-- class加"hide"搜索列表消失 -->
	        	<ul class="search-list hide">
<!-- 	        		<li class="search-item">
	        			<p class="building-title"><span class="orange">绿地</span>山水一号</p>
	        			<p class="building-detail">地址地址地址地址地址地址地址地址</p>
	        		</li> -->
	        	</ul>
	        </div>
	    </div>
	    <div class="container">
	    	<h1>
	    		热门城市
	    		<span class="city-more">
					更多城市
	    			<div class="city city2">
		                <!-- <div class="jiantou"></div> -->
		                <div class="contain">
		                    <ul class="filter">
                                <?php
                                    if ($cities) :
                                    foreach ($cities as $key=>$value) :
                                ?> 
                                <li><?php echo $key;?>
                                    <?php  foreach ($value as $k=>$v) : ?>
                                    <a href='/fang/<?php echo $v->code; ?>'><?php echo $v->area_name; ?></a>
                                    <?php endforeach; ?>
                                </li>
                                <?php
                                    endforeach;
                                    endif; 
                                ?>  
		                    </ul>
		                </div>
		            </div>
	    		</span>
	    	</h1>
	    	<ul class="city-list clearfix">
    	        <?php
                    $imgArr = ["nanjing", "chengdu","shanghai", "beijing", "suzhou", "shenyang"];
                    if ($hot_city) :
                    foreach ($hot_city as $key=>$value) :
                ?>
            	
	    		<li>
	    			<a href="/fang/<?php echo $imgArr[$key];?>">
		    			<img src="<?php echo config_item('photo.plusfang.domain');?>assets/plusfang/img/<?php echo $imgArr[$key];?>.jpg"/>
		    			<div class="city-cover">
		    				<h2><?php echo $value->area_name;?></h2>
		    				<p><?php echo $value->buildingNum;?>个项目</p>
		    			</div>
	    			</a>
	    		</li>
		        <?php
                    endforeach;
                    endif; 
                ?>
	    	</ul>
	    </div>
    	<?php $this->load->view('footer') ?>
    	<script src="/assets/js/building/common.js"></script>
		<script src="/assets/plusfang/js/slider.js" type="text/javascript" charset="utf-8"></script>
	    <script>
	   	$('#banner').flexslider({

			animation: "slide",
	
			direction:"horizontal",
	
			easing:"swing"
	
		});

	    //弹出城市列表
	    $('.banner-search').on('click',function () {
	        if($(this).find('.city').hasClass('show')){
	            $(this).find('.city').removeClass('show')
	        }else{
	            $(this).find('.city').addClass('show')
	            if($('.city2').hasClass('show')){
	            	$('.city2').removeClass('show')
	        	}
	        }
	    })
	    // 更多城市
	   	$(".city-more").click(function(){
	   		if(!$('.city2').hasClass('show')){
	            $('.city2').addClass('show')
	        }
	        return;
	   	});
	   	//城市列表上点击空白关闭弹窗代码！
	    $(document).mouseup(function(e){
	        var _con = $('.city.city2') && $('.search-list');
	        if(!_con.is(e.target) && _con.has(e.target).length === 0){
	            $('.city').removeClass('show')
	            $('.search-list').hide()
	        }
	    });
	    </script>
	</body>
</html>
